using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.Serialization;
using System.Web.Script.Serialization;
using System.Xml.Serialization;
using XCode;
using XCode.Configuration;
using XCode.DataAccessLayer;

namespace BluetoothMachine.Entity
{
    /// <summary>红外数据</summary>
    [Serializable]
    [DataObject]
    [Description("红外数据")]
    [BindTable("InfraredData", Description = "红外数据", ConnName = "MySql", DbType = DatabaseType.None)]
    public partial class InfraredData
    {
        #region 属性
        private Int32 _ID;
        /// <summary>编号</summary>
        [DisplayName("编号")]
        [Description("编号")]
        [DataObjectField(true, true, false, 0)]
        [BindColumn("ID", "编号", "")]
        public Int32 ID { get => _ID; set { if (OnPropertyChanging("ID", value)) { _ID = value; OnPropertyChanged("ID"); } } }

        private String _KeyName;
        /// <summary>按键名</summary>
        [DisplayName("按键名")]
        [Description("按键名")]
        [DataObjectField(false, false, true, 128)]
        [BindColumn("KeyName", "按键名", "")]
        public String KeyName { get => _KeyName; set { if (OnPropertyChanging("KeyName", value)) { _KeyName = value; OnPropertyChanged("KeyName"); } } }

        private String _ProductModel;
        /// <summary>产品型号</summary>
        [DisplayName("产品型号")]
        [Description("产品型号")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("ProductModel", "产品型号", "")]
        public String ProductModel { get => _ProductModel; set { if (OnPropertyChanging("ProductModel", value)) { _ProductModel = value; OnPropertyChanged("ProductModel"); } } }

        private String _RawData;
        /// <summary>原始数据</summary>
        [DisplayName("原始数据")]
        [Description("原始数据")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("RawData", "原始数据", "")]
        public String RawData { get => _RawData; set { if (OnPropertyChanging("RawData", value)) { _RawData = value; OnPropertyChanged("RawData"); } } }

        private String _JudgmentData;
        /// <summary>判断数据</summary>
        [DisplayName("判断数据")]
        [Description("判断数据")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("JudgmentData", "判断数据", "")]
        public String JudgmentData { get => _JudgmentData; set { if (OnPropertyChanging("JudgmentData", value)) { _JudgmentData = value; OnPropertyChanged("JudgmentData"); } } }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case "ID": return _ID;
                    case "KeyName": return _KeyName;
                    case "ProductModel": return _ProductModel;
                    case "RawData": return _RawData;
                    case "JudgmentData": return _JudgmentData;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case "ID": _ID = value.ToInt(); break;
                    case "KeyName": _KeyName = Convert.ToString(value); break;
                    case "ProductModel": _ProductModel = Convert.ToString(value); break;
                    case "RawData": _RawData = Convert.ToString(value); break;
                    case "JudgmentData": _JudgmentData = Convert.ToString(value); break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得红外数据字段信息的快捷方式</summary>
        public partial class _
        {
            /// <summary>编号</summary>
            public static readonly Field ID = FindByName("ID");

            /// <summary>按键名</summary>
            public static readonly Field KeyName = FindByName("KeyName");

            /// <summary>产品型号</summary>
            public static readonly Field ProductModel = FindByName("ProductModel");

            /// <summary>原始数据</summary>
            public static readonly Field RawData = FindByName("RawData");

            /// <summary>判断数据</summary>
            public static readonly Field JudgmentData = FindByName("JudgmentData");

            static Field FindByName(String name) => Meta.Table.FindByName(name);
        }

        /// <summary>取得红外数据字段名称的快捷方式</summary>
        public partial class __
        {
            /// <summary>编号</summary>
            public const String ID = "ID";

            /// <summary>按键名</summary>
            public const String KeyName = "KeyName";

            /// <summary>产品型号</summary>
            public const String ProductModel = "ProductModel";

            /// <summary>原始数据</summary>
            public const String RawData = "RawData";

            /// <summary>判断数据</summary>
            public const String JudgmentData = "JudgmentData";
        }
        #endregion
    }
}